Repository navigation
Preserve the frame axis when computing SSIM for unbatched videos - #43
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #42.
Keep the leading frame axis during spatial filtering even when no separate batch axis is present. Previously the reshape merged that axis into the spatial data and invalidated the final reduction. Unbatched videos now agree with separately evaluated frames and explicit singleton batches. Ordinary image and batched-video paths remain unchanged. The changelog is updated.
Validation
python -m pytest -q zapbench/video_forecasting/metrics_test.py zapbench/video_forecasting/ssim_unbatched_video_test.py24 tests passed. All twelve new regression cases fail on unchanged upstream and pass with the fix. They cover 2D/3D frames, optional channels, one/multiple frames, full maps, scalar scores, explicit-batch equivalence, JIT, gradients and frame isolation. Existing metric tests against dm_pix and scikit-image also pass. No trained model, dataset download or accelerator execution was used.
Tested on macOS CPU with Python 3.12 using real module imports. New test formatting, scoped static checks, syntax checks and
git diff --checkpass. No production dependency or workflow changes.